//引入一级路由组件
import Home from '@/views/Home'
import Search from '@/views/Search'
import Register from '@/views/Register'
import Login from '@/views/Login'
import Detail from '@/views/Detail'
import AddCartSuccess from '@/views/AddCartSuccess'
import ShopCart from '@/views/ShopCart'
import Trade from "@/views/trade"
//路由配置信息
export default[
    {
        name:'trade',
        path:"/trade",
        component:Trade,
        meta:{show:true}
    },
    {
        name:'shopcart',
        path:"/shopcart",
        component:ShopCart,
        meta:{show:true}
    },
    {
        name:'home',
        path:"/home",
        component:Home,
        meta:{show:true}
    },
    {
        name:'search',
        path:"/search/:keyword?",
        component:Search,
        meta:{show:true}
    },
    { 
        name:'register',
        path:"/register",
        component:Register,
        meta:{show:false}
    },
    {   
        name:'login',
        path:"/login",
        component:Login,
        meta:{show:false}
    },
    {
        name:'detail',
        path:"/detail/:skuid?",
        component:Detail,
        meta:{show:true}
    },
    {
        name:'addcartsuccess',
        path:"/addcartsuccess",
        component:AddCartSuccess,
        meta:{show:true}
    },
    //重定向,项目运行时，访问/，立马定向到首页
    {
        path:'/',
        redirect:"/home"
    },
]